From 72835ed4aa93536d30ffc1ab54f9c9d10fc92a28 Mon Sep 17 00:00:00 2001 From: "jrb44@plym.cl.cam.ac.uk" Date: Mon, 3 Oct 2005 23:28:24 +0100 Subject: [PATCH] Possible fix for the SEDF scheduler assertion problem. Signed-off-by: Stephan Diestelhorst --- xen/common/sched_sedf.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c index 1a498dcd30..b6b2f83c71 100644 --- a/xen/common/sched_sedf.c +++ b/xen/common/sched_sedf.c @@ -500,9 +500,15 @@ static inline void update_queues(s_time_t now, struct list_head* runq, curinf->vcpu->domain->domain_id, curinf->vcpu->vcpu_id); __del_from_queue(curinf->vcpu); - + /*move them to their next period*/ curinf->deadl_abs += curinf->period; + /*ensure that the start of the next period is in the future*/ + if (unlikely(PERIOD_BEGIN(curinf) < now)) { + curinf->deadl_abs += + (DIV_UP(now - PERIOD_BEGIN(curinf), + curinf->period)) * curinf->period; + } /*and put them back into the queue*/ __add_to_waitqueue_sort(curinf->vcpu); continue; @@ -645,7 +651,7 @@ static inline struct task_slice sedf_do_extra_schedule (s_time_t now, s_time_t end_xt, struct list_head *extraq[], int cpu) { struct task_slice ret; struct sedf_vcpu_info *runinf; - + ASSERT(end_xt > now); /* Enough time left to use for extratime? */ if (end_xt - now < EXTRA_QUANTUM) goto return_idle; -- 2.30.2